package cn.wx.scholar.core.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import cn.wx.common.persistence.base.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import cn.wx.scholar.core.service.ScholarExpertService;
import cn.wx.scholar.core.entity.ScholarExpert;
import cn.wx.common.persistence.web.ResponseData;
import cn.wx.scholar.core.entity.qo.ScholarExpertQ;
/**
 *   @description : ScholarExpert 控制器
 *   ---------------------------------
 *   @author  
 *   @since 2018-11-15
 */
@RestController
@RequestMapping("/scholarExpert")
public class ScholarExpertController extends BaseController {

    @Autowired
    private ScholarExpertService scholarExpertService;

    /**
     * @description : 通过条件获取ScholarExpert
     * ---------------------------------
     * @author :  
     * @since : Create in 2018-11-15
     */
    @RequestMapping(value = "/query/unique", method = RequestMethod.POST)
    public ResponseData queryUnique(ScholarExpertQ scholarExpertQ) throws Exception {
        return success(scholarExpertService.queryUnique(scholarExpertQ,ScholarExpert.class));
    }

    /**
     * @description : 通过条件获取ScholarExpert分页
     * ---------------------------------
     * @author :  
     * @since : Create in 2018-11-15
     */
    @RequestMapping(value = "/query/page", method = RequestMethod.POST)
    public ResponseData queryPage(ScholarExpertQ scholarExpertQ) throws Exception {
        return success(scholarExpertService.queryPage(scholarExpertQ));
    }

	/**
     * @description : 通过条件获取ScholarExpert
     * ---------------------------------
     * @author : 
     * @since : Create in 2018-11-15
     */
    @RequestMapping(value = "/query/list", method = RequestMethod.POST)
    public ResponseData queryList(ScholarExpertQ scholarExpertQ) throws Exception {
        return success(scholarExpertService.queryList(scholarExpertQ));
    }

    /**
     * @description : 通过id更新ScholarExpert
     * ---------------------------------
     * @author :  
     * @since : Create in 2018-11-15
     */
    @RequestMapping(value = "/modify", method = RequestMethod.POST)
    public ResponseData modify(ScholarExpert scholarExpert) throws Exception {
        return success(scholarExpertService.modify(scholarExpert));
    }
    
    /**
     * @description : 新增ScholarExpert
     * ---------------------------------
     * @author :  
     * @since : Create in 2018-11-15
     */
     @RequestMapping(value = "/create", method = RequestMethod.POST)
     public ResponseData create(ScholarExpert scholarExpert) throws Exception {
        return success(scholarExpertService.create(scholarExpert));
     }
 	
}